﻿<?php
require('configs/include.php');

class a_cargar_programas extends super_controller {

    public function cargar_programas() {
        $cod['programa']['modulo'] = $this->post->id;
        $options['programa']['lvl2'] = "by_modulo";
        $this->orm->connect();
        $this->orm->read_data(array("programa"), $options, $cod);
        $programas = $this->orm->get_objects("programa");
        $this->orm->close();
        if (sizeof($programas) == 0) {
            echo "alert";
        } else {
            $array_programas = array();
            for ($i = 0; $i < sizeof($programas); $i++) {
                $array_programas[$i] = $programas[$i]->get('id') . "$$$$" . $programas[$i]->get('nombre'). "$$$$" . $programas[$i]->get('funcionalidad'). "$$$$" . $programas[$i]->get('codigo_fuente')."$$$$".$programas[$i]->get('fecha_envio');
            }
            $datos_programas = implode("@@@@", $array_programas);
            echo $datos_programas;
        }
    }

    public function run() {
        
            $this->cargar_programas();
       
    }

}

$call = new a_cargar_programas();
$call->run();
?>